import tool from 'src/util/tool'
import util from '_util/index'
const store = util.store
import _ from 'lodash'



export default{
  valid(_this,mid) {
    let vo = util.store.get(_this, 'editVoModal');
    switch (Number(mid)) {
      case 60:
        let fc_serv_up=Number(vo['fc_serv_up']);
        let fc_serv=Number(vo['fc_serv']);
        let fc_sp=Number(vo['fc_sp']);
        let sale_price=Number(vo['sale_price']);
          
        if(sale_price<(fc_serv_up+fc_serv+fc_sp)) {
          util.showMsg(_this, 'quick_error', '分成总额大于售价！');
          return false;
        }
        break;
      case 59:
        let product_attr=vo['product_attr'];
        if(!product_attr) {
          util.showMsg(_this, 'quick_error', '请选择规格！');
          return false;
        }
        break;
      case 58:
        let warehouse_id=vo['warehouse_id'];
        if(!warehouse_id) {
          util.showMsg(_this, 'quick_error', '请选择仓库或新增仓库！');
          return false;
        }
        break;
    }
    return true;
  }
}
